<?php

class Silk_Pms_Block_Adminhtml_Activity_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
{
    public function __construct()
    {
        parent::__construct();

        $this->_objectId   = 'id';
        $this->_blockGroup = 'pms';
        $this->_controller = 'adminhtml_activity';

        $this->_removeButton('save', 'label', Mage::helper('pms')->__('保存'));
        $this->_updateButton('delete', 'label', Mage::helper('pms')->__('删除'));
        $this->_removeButton('reset');

        $this->_addButton('saveandcontinue', array(
            'label'     => Mage::helper('adminhtml')->__('保存'),
            'onclick'   => 'saveAndContinueEdit()',
            'class'     => 'save',
        ), -100);

    }

    public function getHeaderText()
    {
        if( Mage::registry('activity_data') && Mage::registry('activity_data')->getId() ) {
                $id =  $this->getRequest()->getParam('id'); 
                $activitymodel = Mage::getModel("pms/activity")->load($id);
                $href = Mage::helper('core/url')->getHomeUrl()."promotion/activity/view/id/".$activitymodel->getId();
               return  " 活动地址： " . $href;
        } else {
            return Mage::helper('pms')->__('添加活动');
        }
    }

    public function getId()
    {
        $id = $this->getRequest()->getParam('id');
        return $id;
    }
}